home *** CD-ROM | disk | FTP | other *** search
/ World of Education / World of Education.iso / world_x / xcoral16.zip / SCROLL.H < prev    next >
C/C++ Source or Header  |  1993-01-15  |  2KB  |  76 lines

  1. /*
  2. ** Copyright 1989, 1992 by Lionel Fournigault
  3. **
  4. ** Permission to use, copy, and distribute for non-commercial purposes,
  5. ** is hereby granted without fee, providing that the above copyright
  6. ** notice appear in all copies and that both the copyright notice and this
  7. ** permission notice appear in supporting documentation.
  8. ** The software may be modified for your own purposes, but modified versions
  9. ** may not be distributed.
  10. ** This software is provided "as is" without any expressed or implied warranty.
  11. **
  12. **
  13. */
  14.  
  15. #ifndef _SCROLL_H_
  16. #define _SCROLL_H_
  17.  
  18. #define SCROLL_WIDTH 16
  19. #define DEFAULT_SIZE 10
  20.  
  21. #define UP 0
  22. #define DOWN 1
  23. #define TOP 2
  24. #define BOTTOM 3
  25. #define OTHER 4
  26. #define FIRST 5
  27. #define LAST 6
  28. #define NEXT 7
  29. #define PREVIOUS 8
  30. #define CURRENT 9
  31. #define CURSOR 10
  32.  
  33. typedef struct {
  34.     Window    frame;        /* Main window */
  35.     Window    scroll;        /* Le curseur */
  36.     unsigned long fg, bg;    /* Les couleurs */
  37.     int width;        /* Largeur totale */
  38.     int f_height;        /* geometrie frame et scroll */
  39.     int s_height;
  40.     int fx, fy, sx, sy;    
  41.     XFontStruct *font;    /* La fonte utilisee pour le texte a scroller */
  42.     int line;        /* Infos sur le nb de lignes a scroller */
  43.     int linepage;          
  44.     int line_to_scroll;
  45.     double    delta;        /* Pour les calculs */
  46.     int y_min, y_max;    
  47.     int last_dir;        /* Derniere direction pour la scrollbar */
  48.     int last_y;                   
  49.     double    rest;        /* La fraction de ligne restant a scroller */
  50.     char    *text;        /* Vers les infos sur le texte */
  51. } SWin;
  52.  
  53. /*
  54.  *    Public
  55.  */
  56. extern void    InitScroll ( /* display */ );
  57. extern SWin     *MakeScroll ( /* display, parent, x, y */ );
  58. extern void    SetScrollLine ( /*swin, n */ );
  59. extern void    RefreshScroll ( /* display, swin, width, height, n*/ );
  60. extern void    ShowScrollFrame ( /* display, swin */ );
  61. extern int     ButtonPressInScroll ( /* swin, w, y */ );
  62. extern void    HandleScrollBar ( /* display, swin, f */ );
  63. extern int        MoveScrollBar ( /* display, swin, flag, dy */ );
  64. extern void    RefreshScrollBar ( /* display, s */ );
  65. extern void    SetScrollBarSize ( /* display, swin */ );
  66. extern void    RefreshScrollFrame ( /* display, s */ );
  67. extern void    DeleteScroll ( /* display, swin */ );
  68. extern int    ExposeInScroll ( /* display, w, s */ );
  69.  
  70. #define SetScrollFont(s, f)    (s -> font = f)
  71. #define SetScrollLinePage(s, n)    (s -> linepage = n)
  72. #define GetScrollWidth()    (SCROLL_WIDTH)
  73.  
  74. #endif /* _SCROLL_H_ */
  75.  
  76.